<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script src="../vue_lib/vue.js"></script>
    <title>Title</title>
</head>
<body>
<div id="app">
    {{ a }}

</div>
<script>
    var data = {a: 1}
    var vm = new Vue({
        el: "#app",
        data: data
    })
    data.a = '1-i am changing'
    vm.$watch('a',function (newVal,oldVal) {
        console.log(newVal,oldVal)

    })
    vm.a = '2-i change by vm'
    vm.$watch('a',function (newVal,oldVal) {
        console.log(newVal,oldVal)

    })
    vm.$data.a = '3-i change by $data'
</script>
</body>
</html>